﻿namespace KinonekoSoftware.CodariaDB.Runtimes.Abstractions
{
    public interface IRepositoryRuntimeBuilder
    {
        /// <summary>
        /// 注册数据引擎。
        /// </summary>
        /// <typeparam name="TEngine">指定的引擎类型。</typeparam>
        /// <returns>返回一个<see cref="IRepositoryRuntimeBuilder"/></returns>
        IRepositoryRuntimeBuilder Setup<TEngine>() where TEngine : Engine;


        /// <summary>
        /// 注册数据引擎。
        /// </summary>
        /// <param name="engine">是否为懒加载模式</param>
        /// <returns>返回一个<see cref="IRepositoryRuntimeBuilder"/></returns>
        IRepositoryRuntimeBuilder Setup(Engine engine);

        IRepositoryRuntimeBuilder Initialize(IRepositoryInitializer initializer);
        
        IRepositoryRuntimeBuilder Maintain(IRepositoryMaintainer maintainer);
        
        /// <summary>
        /// 构建引擎。
        /// </summary>
        /// <returns>返回一个<see cref="RepositoryRuntime"/></returns>
        RepositoryRuntime Build();
    }
}